package page.ineffable.photostorage.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import page.ineffable.photostorage.util.OsUtils;

/**
 * 图片controller
 *
 * @author lqs2
 * @date 2018/10/29, Mon
 */
@Configuration
public class FileMapConfiguration implements WebMvcConfigurer {


    @Value("${image.map.path}")
    private String imgPath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/img/**").addResourceLocations(imgPath);
    }
}
